<script>

function openRelCa()
{
	$.post("<?php echo $this->base; ?>/relatorio/gerar", $("#frm_rel").serialize(), function(html){
		$(".ajax-relatorio").html(html);
	});
}


$(function(){
	$('.date').datepicker({
		changeMonth: true,
		changeYear: true
	});

	var dates = $('#date_fim, #date_ini').datepicker({
		defaultDate: "+1w",
		changeMonth: true,
		numberOfMonths: 3
	});

});
</script>
<style>
#frm_rel select{
	padding: 10px;
}
</style>
<div style="width: 800px; position: relative; margin: 0 auto;">
	<div style="font-size: 22px; color: #FF9900; text-align: left;">
		Relatorio
	</div>
	<hr style="border-top: 1px dashed #FF9900; margin-top: 5px; margin-bottom: 5px;" />
	<div class="ui-corner-all" style="border: 1px solid gray; padding: 10px; padding-top: 5px; margin-top: 10px;">
		<form id="frm_rel" >
			<table width="100%">
				<tr>
					<td>
						<b>Funcionario</b>
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $this->formSelect("funcrionario", "", "", $this->func); ?>
					</td>
				</tr>
				<tr>
					<td>
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<b>Data Unica</b>
					</td>
				</tr>
				<tr>
					<td>
						<input type="text" name="data_unica" id="data_unica" class="date" />
					</td>
				</tr>
				<tr>
					<td>
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<b>Data Periodo</b>
					</td>
				</tr>
				<tr>
					<td>
						De
						<input type="text" name="data_ini" id="data_ini" class="date" />
						ate
						<input type="text" name="data_fim" id="data_fim" class="date" />
					</td>
				</tr>
				<tr>
					<td>
						<hr />
					</td>
				</tr>
				<tr>
					<td>
						<b>Tipo Pagamento</b>
					</td>
				</tr>
				<tr>
					<td>
						<?php echo $this->formSelect("tp", "", "", $this->tp); ?>
					</td>
				</tr>
			</table>
			<hr style="margin: 10px 0 10px 0;" />
			<div class="button ui-corner-all" onclick="openRelCa();" style="text-align: center; padding: 20px; width: 201px;">
				<div style="position: absolute; margin-top: -9px; margin-left: -10px;">
					<img src="<?php echo $this->base; ?>/public/images/actions/yes.png" />
				</div>
				<b>Gerar</b>
			</div>
		</form>
	</div>
</div>
<div class="ajax-relatorio"></div>